home *** CD-ROM | disk | FTP | other *** search
- function Create_Button(signe_browser,NameId,NbButton,LeftPos,TopPos,ImWidth,ImHeight,signe_ver){
- var meja=null;
- var LiveButton='';
- var LiveButton1='';
- var LiveButton2='';
- var LiveButton3='';
- var LiveButtonSelect1='';
- var LiveButtonSelect2='';
- var LiveButtonNav1='';
- var LiveButtonNav2='';
- var LiveButtonForm='';
- var LiveButtonFormDiv='';
- var NewFrame='';
- var LiveRef='<BASE HREF="http://www.buana.com/content/"> \n';
- TopPos=TopPos+30;
-
- LiveButton1 ='<HTML> \n';
- LiveButton1 +='<TITLE>Live Button: CROSS BROWSER DHTML/JAVASCRIPT: VERSION 1.00</TITLE> \n';
- LiveButton1 +='<HEAD> \n';
-
- LiveButton1 +='<STYLE TYPE="text/css"> \n';
- LiveButton1 +='BODY {background: url(../image/snm_bgsawo.jpg); background-position: -120 0;} \n';
- LiveButton1 +='#'+NameId+' {visibility:inherit; position:absolute; LEFT:'+LeftPos+ '; TOP:'+TopPos+ ';} \n';
-
- for (var j=1; j<NbButton; j++){
-
-
-
-
-
- if (signe_ver==1){
- var ImHeight1=(j-1)*ImHeight;
- LiveButton1 +='#'+NameId+'menu'+j+' {position:absolute; LEFT:0; TOP:'+ImHeight1+ ';} \n';
- }
- if (signe_ver==0){
- var ImWidth1=(j-1)*ImWidth;
- LiveButton1 +='#'+NameId+'menu'+j+' {position:absolute; LEFT:'+ImWidth1+ '; TOP:0;} \n';
- }
- }
- LiveButton1 +='</STYLE> \n';
-
- LiveButton1 +='<SCRIPT LANGUAGE="javascript" SRC="../jscripts/initv01.js"></SCRIPT> \n';
- LiveButton1 +='<SCRIPT LANGUAGE="javascript" SRC="../jscripts/liveim2v01.js"></SCRIPT> \n';
- LiveButton1 +='<SCRIPT LANGUAGE="JavaScript" SRC="../jscripts/browser01.js"></SCRIPT> \n';
- LiveButton1 +='<SCRIPT LANGUAGE="JavaScript"> \n';
- LiveButton1 +='var nbrowser=-1; \n';
-
- for (var j=1; j <NbButton; j++){
-
- LiveButton1 +=' // \n';
- LiveButton1 +=' // Button N0: '+j+' \n';
- LiveButton1 +=' // \n';
-
- LiveButton1 +=' '+NameId+'img'+j+''+j+'click = new Image(); \n';
- LiveButton1 +=' '+NameId+'img'+j+''+j+'over = new Image(); \n';
- LiveButton1 +=' '+NameId+'img'+j+''+j+'out = new Image(); \n';
-
-
- LiveButton1 +=' '+NameId+'img'+j+''+j+'click.src = "../image/snm_btonline_click.gif"; \n';
- LiveButton1 +=' '+NameId+'img'+j+''+j+'over.src = "../image/snm_btonline_over.gif"; \n';
- LiveButton1 +=' '+NameId+'img'+j+''+j+'out.src = "../image/snm_btonline.gif"; \n';
- }
-
- LiveButton1 +='function check_browser(){ \n';
- LiveButton1 +=' get_browser(); \n';
- LiveButton1 +=' if (browser.name == "Microsoft Internet Explorer") nbrowser=1; \n';
- LiveButton1 +=' if (browser.name == "Navigator Netscape") nbrowser=0; \n';
- LiveButton1 +='} \n';
- LiveButton1 +='function '+NameId+'_over(k){ \n';
- LiveButton1 +=' var lay2="'+NameId+'menu"+k; \n';
- LiveButton1 +=' var imlay2="'+NameId+'img"+k; \n';
- LiveButton1 +=' img_over2(nbrowser,"'+NameId+'",lay2,imlay2,k); \n';
- LiveButton1 +=' End'+NameId+'_over(k); \n';
- LiveButton1 +='} \n';
- LiveButton1 +='function '+NameId+'_out(k){ \n';
- LiveButton1 +=' var lay2="'+NameId+'menu"+k; \n';
- LiveButton1 +=' var imlay2="'+NameId+'img"+k; \n';
- LiveButton1 +=' img_out2(nbrowser,"'+NameId+'",lay2,imlay2,k); \n';
- LiveButton1 +=' End'+NameId+'_out(k); \n';
- LiveButton1 +='} \n';
- LiveButton1 +='function '+NameId+'_click(k){ \n';
- LiveButton1 +=' var lay2="'+NameId+'menu"+k; \n';
- LiveButton1 +=' var imlay2="'+NameId+'img"+k; \n';
- LiveButton1 +=' img_click2(nbrowser,"'+NameId+'",lay2,imlay2,k); \n';
- LiveButton1 +=' End'+NameId+'_click(k); \n';
- LiveButton1 +='} \n';
-
- LiveButton1 +='//--------------------------------------------------------- \n';
- LiveButton1 +='// Create Your Own Function Into These Following Functions. \n';
- LiveButton1 +='// k is Number Of Your Related Button. \n';
- LiveButton1 +='// Look this Exemple: \n';
- LiveButton1 +='// function EndLiveButtonIE1_click(k){ \n';
- LiveButton1 +='// if (k==1) location.href="myhtml1.html" \n';
- LiveButton1 +='// if (k==2) location.href="myhtml2.html" \n';
- LiveButton1 +='// } \n';
- LiveButton1 +='//--------------------------------------------------------- \n';
-
- LiveButton1 +='function End'+NameId+'_over(k){} \n';
- LiveButton1 +='function End'+NameId+'_out(k){} \n';
- LiveButton1 +='function End'+NameId+'_click(k){} \n';
- LiveButton1 +='</SCRIPT> \n';
-
- LiveButton2 ='</HEAD> \n';
- LiveButton2 +='<BODY> \n';
- LiveButton2 +='<DIV ID='+NameId+'> \n';
-
- for (var j=1; j<NbButton; j++){
-
- LiveButton2 +=' <DIV ID='+NameId+'menu'+j+'> \n';
- LiveButton2 +=' <A HREF="javascript://" OnMouseOver="'+NameId+'_over('+j+')" OnMouseout="'+NameId+'_out('+j+')" OnClick="'+NameId+'_click('+j+'); return false;"> \n';
- LiveButton2 +=' <IMG BORDER=0 NAME='+NameId+'img'+j+' SRC="../image/snm_btonline.gif"></A> \n';
- LiveButton2 +=' </DIV> \n';
- }
-
- LiveButton2 +='</DIV> \n';
- LiveButton3 ='</BODY> \n';
- LiveButton3 +='</HTML> \n';
- LiveButton3 +='<SCRIPT>var tc=check_browser();</SCRIPT> \n';
-
- LiveButtonSelect1 ='<SCRIPT LANGUAGE="JavaScript" SRC="../jscripts/objvisv01.js"></SCRIPT> \n';
- LiveButtonSelect1 +='<SCRIPT LANGUAGE="javascript" SRC="../jscripts/liveim2v01.js"></SCRIPT> \n';
- LiveButtonSelect1 +='<SCRIPT LANGUAGE="javascript"> \n';
- LiveButtonSelect1 +='// \n';
- LiveButtonSelect1 +='// IMAGE SETUP FOR SELECTS BUTTON \n';
- LiveButtonSelect1 +='// \n';
- LiveButtonSelect1 +='SELECT1img1click = new Image(); \n';
- LiveButtonSelect1 +='SELECT1img1click.src = "../image/snm_code_click.gif"; \n';
- LiveButtonSelect1 +='SELECT1img1over = new Image(); \n';
- LiveButtonSelect1 +='SELECT1img1over.src = "../image/snm_code_over.gif"; \n';
- LiveButtonSelect1 +='SELECT1img1out = new Image(); \n';
- LiveButtonSelect1 +='SELECT1img1out.src = "../image/snm_code.gif"; \n';
- LiveButtonSelect1 +='// \n';
- LiveButtonSelect1 +='SELECT2img2click = new Image(); \n';
- LiveButtonSelect1 +='SELECT2img2click.src = "../image/snm_preview_click.gif"; \n';
- LiveButtonSelect1 +='SELECT2img2over = new Image(); \n';
- LiveButtonSelect1 +='SELECT2img2over.src = "../image/snm_preview_over.gif"; \n';
- LiveButtonSelect1 +='SELECT2img2out = new Image(); \n';
- LiveButtonSelect1 +='SELECT2img2out.src = "../image/snm_preview.gif"; \n';
- LiveButtonSelect1 +='// \n';
- LiveButtonSelect1 +='SELECT3img3click = new Image(); \n';
- LiveButtonSelect1 +='SELECT3img3click.src = "../image/snm_back_click.gif"; \n';
- LiveButtonSelect1 +='SELECT3img3over = new Image(); \n';
- LiveButtonSelect1 +='SELECT3img3over.src = "../image/snm_back_over.gif"; \n';
- LiveButtonSelect1 +='SELECT3img3out = new Image(); \n';
- LiveButtonSelect1 +='SELECT3img3out.src = "../image/snm_back.gif"; \n';
- LiveButtonSelect1 +='function select_over(k){ \n';
- LiveButtonSelect1 +=' ly1="SELECT"; \n';
- LiveButtonSelect1 +=' ly2="SELECT"+k; \n';
- LiveButtonSelect1 +=' Img=ly2+"img"; \n';
- LiveButtonSelect1 +=' img_over2(nbrowser,ly1,ly2,Img,k); \n';
- LiveButtonSelect1 +='} \n';
- LiveButtonSelect1 +='function select_out(k){ \n';
- LiveButtonSelect1 +=' ly1="SELECT"; \n';
- LiveButtonSelect1 +=' ly2="SELECT"+k; \n';
- LiveButtonSelect1 +=' Img=ly2+"img"; \n';
- LiveButtonSelect1 +=' img_out2(nbrowser,ly1,ly2,Img,k); \n';
- LiveButtonSelect1 +='} \n';
- LiveButtonSelect1 +='function select_click(k){ \n';
- LiveButtonSelect1 +=' ly1="SELECT"; \n';
- LiveButtonSelect1 +=' ly2="SELECT"+k; \n';
- LiveButtonSelect1 +=' Img=ly2+"img"; \n';
- LiveButtonSelect1 +=' img_click2(nbrowser,ly1,ly2,Img,k); \n';
-
- LiveButtonSelect1 +=' if (k==3) parent.frames[1].history.go(-1); \n';
- LiveButtonSelect1 +=' if (k==1) Obj_Vis(nbrowser,1,"'+NameId+'","hidden"); \n';
- LiveButtonSelect1 +=' if (k==1) Obj_Vis(nbrowser,1,"SOURCE","inherit"); \n';
-
- LiveButtonSelect1 +=' if (k==2) Obj_Vis(nbrowser,1,"SOURCE","hidden"); \n';
- LiveButtonSelect1 +=' if (k==2) Obj_Vis(nbrowser,1,"'+NameId+'","inherit"); \n';
- LiveButtonSelect1 +='} \n';
- LiveButtonSelect1 +='</SCRIPT> \n';
-
- LiveButtonSelect2 ='<DIV ID=SELECT STYLE="position:absolute; left:10; top:0;"> \n';
- LiveButtonSelect2 +=' <DIV ID=SELECT1 STYLE="position:absolute; left:20; top:0;"> \n';
- LiveButtonSelect2 +=' <A HREF="javascript://" \n';
- LiveButtonSelect2 +=' OnMouseOver="select_over(1)" \n';
- LiveButtonSelect2 +=' OnMouseOut="select_out(1)" \n';
- LiveButtonSelect2 +=' OnClick="select_click(1); return false;"> \n';
- LiveButtonSelect2 +=' <IMG BORDER=0 NAME=SELECT1img SRC="../image/snm_code.gif"></A> \n';
- LiveButtonSelect2 +=' </DIV> \n';
- LiveButtonSelect2 +=' <DIV ID=SELECT2 STYLE="position:absolute; left:120; top:0;"> \n';
- LiveButtonSelect2 +=' <A HREF="javascript://" \n';
- LiveButtonSelect2 +=' OnMouseOver="select_over(2)" \n';
- LiveButtonSelect2 +=' OnMouseOut="select_out(2)" \n';
- LiveButtonSelect2 +=' OnClick="select_click(2); return false;"> \n';
- LiveButtonSelect2 +=' <IMG BORDER=0 NAME=SELECT2img SRC="../image/snm_preview.gif"></A> \n';
- LiveButtonSelect2 +=' </DIV> \n';
- LiveButtonSelect2 +=' <DIV ID=SELECT3 STYLE="position:absolute; left:220; top:0;"> \n';
- LiveButtonSelect2 +=' <A HREF="javascript://" \n';
- LiveButtonSelect2 +=' OnMouseOver="select_over(3)" \n';
- LiveButtonSelect2 +=' OnMouseOut="select_out(3)" \n';
- LiveButtonSelect2 +=' OnClick="select_click(3); return false;"> \n';
- LiveButtonSelect2 +=' <IMG BORDER=0 NAME=SELECT3img SRC="../image/snm_back.gif"></A> \n';
- LiveButtonSelect2 +=' </DIV> \n';
- LiveButtonSelect2 +='</DIV> \n';
-
- screen_width();
-
- if (MyScreenWidth==800) {
- var MyRows=16;
- var MyCols=50;
- }else{
- var MyRows=12;
- var MyCols=38;
- }
-
- LiveButtonForm =' <FORM NAME=test> \n';
- LiveButtonForm +=' <TEXTAREA NAME=test2 name=output ROWS='+MyRows+' COLS='+MyCols+'> \n';
- LiveButtonForm +=LiveRef+LiveButton1+LiveButton2+LiveButton3;
- LiveButtonForm +=' </TEXTAREA> \n';
- LiveButtonForm +=' </FORM > \n';
-
- LiveButtonFormDiv ='<DIV ID=SOURCE STYLE="visibility:hidden; position:absolute; left:10; top:30;"> \n';
- LiveButtonFormDiv +=LiveButtonForm;
- LiveButtonFormDiv +='</DIV> \n';
-
-
-
- if (signe_browser==1){
-
- LiveButton=LiveButton1+LiveButtonSelect1+LiveButton2+LiveButtonSelect2+LiveButtonFormDiv+LiveButton3;
-
-
- // meja=window.open("","online","width=580,height=380,left=0,top=0,menubar=yes");
- // meja.document.write(LiveButton);
- // meja.document.close();
- // meja.focus();
-
- parent.frames[1].document.write(LiveButton);
- parent.frames[1].document.close();
-
-
- }
-
- if (signe_browser==0){
-
-
- Obj_Vis(nbrowser,1,'CONTENT','hidden');
-
- document.SOURCE.document.open();
- document.SOURCE.document.write(LiveButtonForm);
- document.SOURCE.document.close();
-
- NameId='MyFunction';
-
-
- LiveButtonNav1 ='<DIV ID='+NameId+' STYLE="position:absolute; LEFT:'+LeftPos+ '; TOP:'+TopPos+ ';"> ';
-
- for (var j=1; j<NbButton; j++){
-
- if (signe_ver==1){
- var ImHeight1=(j-1)*ImHeight;
- LiveButtonNav2 =' position:absolute; LEFT:0; TOP:'+ImHeight1+';' ;
- }
- if (signe_ver==0){
- var ImWidth1=(j-1)*ImWidth;
- LiveButtonNav2 =' position:absolute; LEFT:'+ImWidth1+ '; TOP:0;';
- }
-
- LiveButtonNav1 +=' <DIV ID='+NameId+'menuClick'+j+' STYLE="'+LiveButtonNav2+'"> ';
- LiveButtonNav1 +=' <A HREF="javascript://" OnMouseOver="'+NameId+'_over('+j+')" OnMouseout="'+NameId+'_out('+j+')" OnClick="'+NameId+'_click('+j+'); return false;"> ';
- LiveButtonNav1 +=' <IMG BORDER=0 NAME='+NameId+'img SRC="../image/snm_btonline_click.gif"></A> ';
- LiveButtonNav1 +=' </DIV> ';
-
-
- LiveButtonNav1 +=' <DIV ID='+NameId+'menuOver'+j+' STYLE="'+LiveButtonNav2+'"> ';
- LiveButtonNav1 +=' <A HREF="javascript://" OnMouseOver="'+NameId+'_over('+j+')" OnMouseout="'+NameId+'_out('+j+')" OnClick="'+NameId+'_click('+j+'); return false;"> ';
- LiveButtonNav1 +=' <IMG BORDER=0 NAME='+NameId+'img SRC="../image/snm_btonline_over.gif"></A> ';
- LiveButtonNav1 +=' </DIV> ';
-
- LiveButtonNav1 +=' <DIV ID='+NameId+'menuOut'+j+' STYLE="'+LiveButtonNav2+'"> ';
- LiveButtonNav1 +=' <A HREF="javascript://" OnMouseOver="'+NameId+'_over('+j+')" OnMouseout="'+NameId+'_out('+j+')" OnClick="'+NameId+'_click('+j+'); return false;"> ';
- LiveButtonNav1 +=' <IMG BORDER=0 NAME='+NameId+'img SRC="../image/snm_btonline.gif"></A> ';
- LiveButtonNav1 +=' </DIV> ';
-
- }
-
- LiveButtonNav1 +='</DIV> ';
-
-
- document.PREVIEW.document.open();
- document.PREVIEW.document.write(LiveButtonNav1);
- document.PREVIEW.document.close();
-
- Obj_Vis(nbrowser,1,'SELECT','inherit');
- Obj_Vis(nbrowser,1,'PREVIEW','inherit');
- window.scroll(0,0);
-
-
- }
-
- }
-